# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>

pkgname=oha
pkgver=0.5.8
pkgrel=1
pkgdesc="Ohayou(おはよう), HTTP load generator, inspired by rakyll/hey with tui animation"
arch=('loong64' 'x86_64')
url="https://github.com/hatoo/oha"
license=('MIT')
depends=('openssl' 'gcc-libs')
makedepends=('rust')
source=($pkgname-$pkgver.tar.gz::https://github.com/hatoo/oha/archive/refs/tags/v${pkgver}.tar.gz)
sha512sums=('6744cb2c7bb37d025bb7bb47f518ba30987c6c8bfba1ce26a2d3072cdbfa56af6d3e0913e6a681eeafc858c056243daa3979727e2244ecd2246d8950db1884c7')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  cargo build --release --locked
}

check() {
  cd "$srcdir/$pkgname-$pkgver"

  cargo test --release --locked
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -Dm755 target/release/oha "$pkgdir"/usr/bin/oha
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
